package com.gome.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.danga.MemCached.MemCachedClient;

public class MClient {

	public static void main(String[] args) {

		ApplicationContext ctx = new FileSystemXmlApplicationContext(
				"E:\\RB\\RbBg\\WebRoot\\WEB-INF\\applicationcontext.xml");

		MemCachedClient mc = (MemCachedClient) ctx.getBean("memcachedClient");
		for (int i = 0; i < 100; i++) {
			// try{Thread.sleep(2000);}catch(Exception e){}
			mc.set("key" + i, "value" + i);
		}
		try {
			Thread.sleep(5000);
		} catch (Exception e) {
		}
		for (int i = 0; i < 100; i++) {
			System.out.println("get " + i + " value " + mc.get("key" + i));
		}
	}

}
